import { App } from 'vue'
import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import { createRouterGuards } from './guard'

const routes: RouteRecordRaw[] = [
  // 解决路由动态传参错误的问题
  {
    path: '/:catchAll(.*)',
    component: () => import('@/view/error/404.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

createRouterGuards(router)

export default router
